<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui" template="../template/layout.xhtml">


	<ui:define name="cssStyle">
	.ui-message-error{
	padding:5px;
	margin:7px 0px 0px 0px;
	width:173px;
	}
	</ui:define>

	<ui:define name="content">

		<h:form id="form" enctype="multipart/form-data">
			<p:growl globalOnly="true" showDetail="true" autoUpdate="true" />
			<h:inputHidden value="#{editalMB.bean.idEdital}"></h:inputHidden>
			<h:panelGrid columns="2" width="100%">

				<p:column width="50%">
					<h:panelGrid  columns="2" width="100%">
						
						<p:column><h1 class="titulo-h1">Cadastro de Edital</h1></p:column>
						<p:column></p:column>
						
						<p:column>
							
							<p:outputLabel value="Data para abertura:" /><br />
							<p:calendar id="dateAbertura" requiredMessage="Campo Obrigatório!" required="true" value="#{editalMB.bean.dataAbertura}" pattern="dd/MM/yyyy HH:mm" /><br /> 
							<p:message for="dateAbertura" /><br/>
							
							<p:spacer height="10" /><br />
							<p:commandButton action="#{editalMB.salvar}" value="Salvar" ajax="false" />
							<p:spacer width="10"></p:spacer>
							<p:commandButton value="Voltar" ajax="false" />

						</p:column>
						
						<p:column>
						
							<p:outputLabel value="Data para fechamento:" /><br />
							<p:calendar id="dateFechamento" requiredMessage="Campo Obrigatório!" required="true" value="#{editalMB.bean.dataFechamento}" pattern="dd/MM/yyyy HH:mm" /><br /> 
							<p:message for="dateFechamento" /><br/>
							
						 </p:column>


					</h:panelGrid>
				</p:column>

				<p:column>
					
					<center>
					<h1 class="titulo-h1">Informações do Produto/Serviço</h1>
						<h:panelGrid columns="1" style="width:200px;">

							<h2 class="titulo-h2">#{editalMB.produto.nome}</h2>

							<p:graphicImage value="#{produtoMB.getImageFromHell()}"
								style="width:200px;height:200px;">
								<f:param name="id_produto"
									value="#{editalMB.produto.codigo}" />
							</p:graphicImage>
							<p>
								<h:outputText value="#{editalMB.produto.descricao}" />
							</p>
						</h:panelGrid>
					</center>

				</p:column>

			</h:panelGrid>

		</h:form>

	</ui:define>

</ui:composition>